#include <iostream>
#include <vector>

typedef std::vector<unsigned> Array;
typedef std::vector<Array> Table;

void GetWeight(Array& weight)
{
	if (!weight.size())
		return;
	
	for (unsigned row = 0u; row != weight.size(); ++row)
	{
		for (unsigned prev = weight[0], i = 1, temp; i < row; ++i)
		{
			temp = weight[i];
			weight[i] += prev;
			prev = temp;
		}
		weight[row] = 1u;
	}
}

bool GetSequenceUtility(Array& weight, unsigned sum, unsigned sum_current, Array& stack, Array& mark)
{
	if (stack.size() == weight.size())
	{
		return sum_current == sum;
	}

	for (unsigned i = 1u; i <= weight.size(); ++i)
	{
		if (mark[i])
			continue;
		
		stack.push_back(i);
		mark[i] = 1u;

		if (sum_current + i * weight[stack.size() - 1u] <= sum &&
				GetSequenceUtility(weight, sum,
				sum_current + i * weight[stack.size() - 1u], stack, mark))
			return true;
		
		mark[i] = 0u;
		stack.pop_back();
	}

	return false;
}

Array& GetSequence(unsigned n, unsigned sum)
{
	static Array sequence;

	Array weight(n);
	Array mark(n + 1u, 0u);

	GetWeight(weight);
	GetSequenceUtility(weight, sum, 0u, sequence, mark);

	return sequence;
}

int main()
{
	unsigned n, sum;
	std::cin >> n >> sum;

	Array& answer = GetSequence(n, sum);

	for (unsigned i = 0; i != answer.size(); ++i)
	{
		std::cout << answer[i];
		std::cout.put(i + 1u == answer.size() ? '\n' : ' ');
	}

	return 0;
}